package com.monster.mechanic.utils.format;

import java.text.MessageFormat;

import com.monster.mechanic.utils.constants.ResourcesConstants;

public class ExceptionUtil {
	private ExceptionUtil() {
	}

	private static String getMessage() {
		return "[{0}:{1}.{2}] Error: {3}";
	}

	private static String getText(Throwable exception, String ownText) {
		StackTraceElement[] stackTraceElements = exception.getStackTrace();
		if (ownText != null)
			ownText = exception.getMessage().concat("[").concat(ownText)
					.concat("]");
		else
			ownText = exception.getMessage();
		Object[] valores = new Object[] { ResourcesConstants.PATTERN_NAME_FILE,
				stackTraceElements[0].getClassName(),
				stackTraceElements[0].getMethodName(), ownText };
		return MessageFormat.format(getMessage(), valores);
	}

	public static void mensaje(Throwable exception, String propio) {
	}

	public static void mensaje(Throwable exception) {
		mensaje(exception, null);
	}

	public static void notificar(Throwable exception) {
		mensaje(exception, null);
	}
}
